package com.lihepeng.leecode.frequency.ArrayList;

import org.junit.Test;

/**
 *  反转字符串
 */
public class Solution91 {
    public String solve (String str) {
        char[] chars = str.toCharArray();
        int left =0;
        int right = chars.length-1;
        while (left <=right) {
           char tmep =  chars[left];
           chars[left] = chars[right];
           chars[right] = tmep;
           left ++;
           right --;
        }
        return new String(chars);
    }
    @Test
    public void runTest() {
        System.out.println(solve("abcde"));
    }
}
